package com.ruoyi.bl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bl.mapper.BlUserAddressMapper;
import com.ruoyi.bl.domain.BlUserAddress;
import com.ruoyi.bl.service.IBlUserAddressService;

/**
 * 用户地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-24
 */
@Service
public class BlUserAddressServiceImpl implements IBlUserAddressService
{
    @Autowired
    private BlUserAddressMapper blUserAddressMapper;

    /**
     * 查询用户地址
     * 
     * @param addressId 用户地址主键
     * @return 用户地址
     */
    @Override
    public BlUserAddress selectBlUserAddressByAddressId(Long addressId)
    {
        return blUserAddressMapper.selectBlUserAddressByAddressId(addressId);
    }

    /**
     * 查询用户地址列表
     * 
     * @param blUserAddress 用户地址
     * @return 用户地址
     */
    @Override
    public List<BlUserAddress> selectBlUserAddressList(BlUserAddress blUserAddress)
    {
        return blUserAddressMapper.selectBlUserAddressList(blUserAddress);
    }

    /**
     * 新增用户地址
     * 
     * @param blUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int insertBlUserAddress(BlUserAddress blUserAddress)
    {
        blUserAddress.setCreateTime(DateUtils.getNowDate());
        return blUserAddressMapper.insertBlUserAddress(blUserAddress);
    }

    /**
     * 修改用户地址
     * 
     * @param blUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int updateBlUserAddress(BlUserAddress blUserAddress)
    {
        blUserAddress.setUpdateTime(DateUtils.getNowDate());
        return blUserAddressMapper.updateBlUserAddress(blUserAddress);
    }

    /**
     * 批量删除用户地址
     * 
     * @param addressIds 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteBlUserAddressByAddressIds(Long[] addressIds)
    {
        return blUserAddressMapper.deleteBlUserAddressByAddressIds(addressIds);
    }

    /**
     * 删除用户地址信息
     * 
     * @param addressId 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteBlUserAddressByAddressId(Long addressId)
    {
        return blUserAddressMapper.deleteBlUserAddressByAddressId(addressId);
    }
}
